import {
  postMessage,
  loadBridge,
} from './bridge'
import { log, error, warn } from './log';

import { isString, isIos } from './utils'

export default {
  loadBridge(){
    loadBridge()
  },
  appStore (url) {
    if (!isIos()) {
      error('非ios设备不支持跳转appStore')
      return false
    }
    if (!isString(url)) {
      warn('跳转appStore参数应该是字符串')
    }
    return postMessage('func_appStore', { url })
  }
}
